<?php echo $this->partial('header.phtml', array('urlbase'=>$this->urlbase)); ?>  

<!-- Main -->
<div class="wrapper style1">

    <div class="container">
        <div class="row 200%">
            
            <div class="4u" id="sidebar">
                <h3>Conheça Nosso Portfólio:</h3>
                <?php foreach($this->portfolios as $por){ ?>
                <section>
                    <a href="<?php echo $this->urlbase.'/'.$this->controller.'/index/id/'.$por['POR_ID']; ?>"><?php echo $por['POR_NOM']?></a>
                </section>
                <?php } ?>
            </div>
            
            <?php if($this->portfolio['POR_ID'] > 0){ 
                $img = glob('public/upload/stportfolio/'.$this->portfolio['POR_ID'].'.*');
                $img = $img[0];
            ?>
            <div class="8u important(collapse)" id="content">
                <article id="main">
                    <header>
                        <h2><?php echo $this->portfolio['POR_NOM']; ?></h2>
                        <p>
                           <?php echo $this->portfolio['POR_DSC']; ?>
                        </p>
                    </header>
                    <a href="#" class="image featured"><img src="<?php echo $this->urlbase.'/'.$img; ?>" alt="<?php echo $this->portfolio['POR_NOM']; ?>" /></a>
                    <p>
                        <?php echo $this->portfolio['POR_TXT']; ?>
                    </p>
                    
                    <div class="fbComments">
                        <?php 
                            $url = $_SERVER['HTTP_HOST'].''.$this->urlbase.'/'.$this->controller.'/index/id/'.$this->portfolio['POR_ID'];
                            $pos = strpos($url, 'www.');
                            if ($pos === false) $url = 'http://www.'.$url;
                            else $url = 'http://'.$url; 
                            
                        ?>
                        
                        <div id="fb-root"></div>

                        <script>(function(d, s, id) {
                          var js, fjs = d.getElementsByTagName(s)[0];
                          if (d.getElementById(id)) return;
                          js = d.createElement(s); js.id = id;
                          js.src = "//connect.facebook.net/pt_BR/sdk.js#xfbml=1&appId=688243397900389&version=v2.0";
                          fjs.parentNode.insertBefore(js, fjs);
                        }(document, 'script', 'facebook-jssdk'));</script>

                        <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($url); ?>&amp;width&amp;layout=standard&amp;action=like&amp;show_faces=false&amp;share=true&amp;height=35&amp;appId=688243397900389" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100%; height:35px;" allowTransparency="true"></iframe>

                        <div class="fb-comments" data-href="<?php echo $url; ?>" data-width="100%" data-numposts="5" data-colorscheme="light"></div>
                    </div>
                    
                </article>
            </div>
            <?php } ?>
            
        </div>
    </div>
</div>

<?php echo $this->partial('footer.phtml', array('urlbase'=>$this->urlbase)); ?>